<template>
  <div class="myContainer">
    <!-- 头部标题 start -->  
    <el-row class="myHeadeTitle">
      <el-col :span="10" class="myLineHeight_35px">
        {{title}}
      </el-col>
      <el-col :span="14" class="myTextAlignRight">
        <!-- <el-button type="primary" class="myBgGreen" >新增</el-button> -->
      </el-col>
    </el-row>
    <el-row class="mymarginTop_10px">
      <el-col :span="3" class="myTextAlignRight myLineHeight_35px">
        可查看人员范围：
      </el-col>
      <el-col :span="8">
        <LinkagePeople 
              v-if="isTrue"
              :datamsg="dataList"
              @getChildData="getComplaint_chargeuser($event)"></LinkagePeople>
      </el-col>
    </el-row>
    <el-row class="myPaddingTop_10px">
      <el-col :offset="3">
        <el-button type="primary" class="myBgGreen" @click="onSeva">保存设置</el-button>
        <el-button type="primary" class="myBgGreen" @click="onBack">返回</el-button>
      </el-col>
    </el-row>
  </div>
</template>  

<style scoped>
  .myContainer{
    background: #fff;
    padding: 10px;
  }
  .myHeadeTitle{
    color: #000;
    font-weight: 500;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dbdbdb;
    margin-bottom:10px; 
  }
  .myHeadeTitle:before,.myHeadeTitle:after{
    content: " ";
    display: block;
    clear: both;
  }
  .myBgGreen{
    background: #00c2a9;
    border-color: #00c2a9;
    color: #fff;
    margin-top: 2px;
  }
  .myLineHeight_35px{
    line-height: 35px;
  }
  .myTextAlignRight{
    text-align: right;
  }
  .myBgGreen:hover{
    background: #33ceba;
  }
  .myPaddingTop_10px{
    padding-top: 10px;
  }  
  .myLeftMsg{
    line-height: 40px;
    text-align: right;
    padding-right: 10px;
  }
  .myPaddingBottom_10px{
    padding-bottom: 10px;
  }
  .myVA_M{
    vertical-align: middle;
  }
  .myPadding_20px{
    padding: 20px;
  }
  .myDialogSearchText{
    width: 360px;
  }
  .myLineHeight_45px{
    line-height: 45px;    
  }
  .myOV_y_400px{
    max-height: 400px;
    min-height: 200px;
    overflow-y:scroll;
  }
  .mymarginTop_10px{
    margin-top: 10px;
  }
</style>

<script>
  import { getPayPush , setPayPush } from '@/api/pay';
  import LinkagePeople from 'components/LinkagePeople.vue';
  export default {
    data(){
      return{
        title:"缴费推送设置",
        flag:true,
        status:1,
        dataList:{},
        isTrue:false
      }
    },
    components: {
      LinkagePeople
    },
    mounted(){
      document.title = this.title;
      this.onGetPayPush();
    },
    methods:{
      handleSizeChange(val) {//每页条数控制
        this.page_size = val;
      },
      handleCurrentChange(val) {//每页
        this.page_num = val;
      },
      onSearch:function(){

      },
      handleChange:function(val){

      },
      onBack(){
        this.$router.go(-1)
      },
      getComplaint_chargeuser(val,index){
        this.dataList=val;
      },
      onSeva(){//保存
        let vm=this;
        if(!vm.dataList.scope){
          vm.$message.error("请将选项选择完整！");
          return;
        }
        setPayPush(vm.dataList).then(response => {
          let res=response.data;
          vm.$message.success("执行成功！");
        }).catch(error => {
          vm.$message.error("执行失败！");
        })
      },
      onGetPayPush(){
        let vm=this;
        let params={
          type:1
        }
        getPayPush(params).then(response => {
          let res=response.data;
          vm.dataList=res;
          vm.isTrue=true;
        }).catch(error => {
          console.log(error)
        })
      }
    }

  }

</script>  



